home *** CD-ROM | disk | FTP | other *** search
- Documentation for rexxserdev.library
-
- copyright © 1988 by Joseph M. Stivaletta All rights reserved.
- --------------------------------------------------------------------------
-
- This is the beta version of my serial device function library for ARexx.
- Most of the functions have been implemented. I have not yet incorporated
- xon/xoff flow control. I hope to have these in the next version.
-
- This library uses ARP functions. Therefore, you must have arp.library in
- your LIBS: directory. You must also place my library into your LIBS:
- directory also. To use the Arexx serial device library, you must add it
- to the global library list using the either the addlib() function or the
- rxlib() command
-
- The current version number of this library is 1 and the query function offset
- is -30. examples follow:
-
- addlib( 'rexxserdev.library', 0, -30, 1 )
- rxlib rexxserdev.library 0 -30 1
-
-
- The rexxserdev.library was written to provide an easy to use interface
- between ARexx programs and the Amiga's internal serial device. The serial
- device is opened as shared so take care when accessing the serial device
- from more than one application. All I/O requests to the serial device are
- synchronous not asynchronous. Therefore, a call to a function will not
- return to the application until that function is completed. Due to the
- synchronous nature of the library functions the SerStart() and SerStop()
- functions may not work as designed for write calls. The actual effect
- of these calls has yet to be determined. At the current time I have not
- implemented SerStart(), SerStop() and SerGetParms().
-
-
- ==========================================================================
- Using the functions
-
-
- SerOpen()
- Usage: boolean = SerOpen()
- Opens the serial device and allocates the I/O requests and reply ports.
- Example:
- say SerOpen() ==> 1
-
-
- SerClose()
- Usage: boolean = SerClose()
- Closes the serial device and deallocates the I/O requests and reply ports.
- Example:
- say SerClose() ==> 1
-
-
- SerClear()
- Usage: boolean = SerClear()
- Clears the internal read buffer.
- Example:
- say SerClear() ==> 1
-
-
- SerFlush()
- Usage: boolean = SerFlush({'R' | 'W'})
- Aborts all queued I/O requests in either the read or write request queue.
- Example:
- say SerFlush( 'R' ) ==> 1
-
-
- SerRead()
- Usage: charsRcvd = SerRead(buffer,length)
- Read a number of characters from the serial port. The number of characters
- read is specified by length. The buffer is an internal read buffer supplied
- by the calling ARexx program. This buffer is for use by the
- rexxserdev.library and not by the ARexx application.
- Example:
- block = allocmem( 20 )
- addr = c2d( block )
- say SerRead( addr, 20 ) ==> A string of 20 chara
-
-
- SerReset()
- Usage: boolean = SerReset()
- Reinitializes the serial device to it's default state.
- Example:
- say SerReset() ==> 1
-
-
- SerStart()
- Usage: boolean = SerStart({'R' | 'W'})
- Restarts reading or writing stopped by a previous SerStop() function. Not
- yet implemented.
- Examples:
- say SerStart( 'W' ) ==> 1
-
-
- SerStop()
- Usage: boolean = SerStop({'R' | 'W'})
- Stops the currently executing read or write command. Not yet implemented.
- Example:
- say SerStop( 'R' ) ==> 1
-
-
- SerWrite()
- Usage: boolean = SerWrite(buffer,length)
- Sends the characters in the buffer to the serial port.
- Example:
- text = 'send stuff out port'
- say SerWrite( text, length( text ) ) ==> 1
-
-
- SerBreak()
- Usage: boolean = SerBreak()
- Sends a break signal.
- Examples:
- say SerBreak() ==> 1
-
-
- SerQuery()
- Usage: status = SerQuery()
- Returns status of the serial device. The first substring indicates the
- validity of the rest of the string. 0 indicates that an error was returned
- from the query command and no additional information is contained within
- the status string. 1 indicates that the call was successful and the string
- contains two more substrings. The second substring is the number in decimal
- ASCII of the number of characters currently in the internal read buffer.
- The third substring is the status word in decimal ASCII it is defined as
- follows:
- Bit no. Meaning of Bit
-
- 0-2 Reserved
- 3 DSR - Data Set Ready (bit = 0)
- 4 CTS - Clear To Send (bit = 0)
- 5 DCD - Data Carrier Detect (bit = 0)
- 6 RTS - Ready To Send (bit = 0)
- 7 DTR - Data Terminal Ready (bit = 0)
- 8 Read buffer overflow (bit = 1)
- 9 Break signal sent (bit = 1)
- 10 Break signal received (bit = 1)
- 11 Transmit XOFF (bit = 1)
- 12 Received XOFF (bit = 1)
- 13-15 Reserved
- Examples:
- say SerQuery() ==> 1 23 0
- | | +--> Status bits
- | +-----> Number of characters received
- +-------> Validity of status information
-
-
- SerSetParms()
- Usage: boolean = SerSetParms(baud,databits,paritybits,stopbits,[flowCtl],[brkTime])
- Sets the serial device parameters defined below. The optional flowCtl and
- brkTime parameters are not yet implemented. I have not yet incorporated
- SERF_RAD_BOOGIE so take care when using very high baud rates.
-
- baud = allowed range is from 110 to 29,200
- databits = allowed range from 1 to 8
- paritybits = {'N' | 'E' | 'O' | 'M' | 'S'}
- 'N' = No parity
- 'E' = Even parity
- 'O' = Odd parity
- 'M' = Mark parity
- 'S' = Space parity
- stopbits = {'1' | '2'}
- flowCtl = {'0' | '1'}
- '0' = Disable Xon/Xoff flow control
- '1' = Enable Xon/Xoff flow control
- the default is disabled Xon/Xoff flow control
- brkTime = duration of break signal in microseconds; the default value is
- 250,000 microseconds.
-
- Examples:
- say SerSetParms( 9600, 7, e, 1 ) ==> 1
-
-
- SerGetParms()
- Usage: SerGetParms()
- This function returns the current serial device parameters. This function
- has not been implemented yet.
- Examples:
- say SerGetParms() ==> 1 9600 7 e 1 2500000 0
-
-
- ==========================================================================
- User rights
-
- This is a beta version of my library and I do not guarantee that it is
- free from bugs. It has been tested but not rigorously. I am making it
- available now so that people can begin using it. I will try to keep
- future versions downwardly compatible but make no promises that it will
- not change slightly based on user feedback.
-
- These programs are freely distributable in the public domain as long as
- this document is included. I retain the rights to their use. This means
- that they cannot be sold for profit by anyone without my written permission.
-
-
- ==========================================================================
- Disclaimer BS
-
- If this software, blows up your machine, melts you hard drive, causes
- loss of hair, mental anguish, mental disorders, or marital difficuties
- ending in divorce, I will not be held liable. I make no warranties, either
- expressed or implied, with respect to the programs described herein,
- their quality, performance, or fitness for any particular purpose. These
- programs are distributed "AS IS." The entire risk as to their quality and
- performance is with the user. I promise only to fix the bugs and to
- improve and enhance the code as I deem able in my spare time.
-
-
- ==========================================================================
- Problem reporting
-
- If you find any errors or have any problems, your flames can reach me
- at the following locations:
-
- Amiga Colony BBS (617-641-1629):
- Name: Joe Stivaletta
-
- IDCMP BBS (617-769-3172):
- Name: Joe Stivaletta
-
- CompuServe:
- PIN: 72155,516
-
- People Link:
- ID: Blackhawk
-
- Delphi:
- ID: Blackhawk
-
- Bix:
- ID: jstivaletta
- Joseph M. Stivaletta
- P.O. Box 125
- Bedford, MA 01730
- 14 June 1988